package com.derbysoft.lowcostadapter.commons.model;

import com.derbysoft.lowcostadapter.commons.redis.service.RedisSerializable;
import com.derbysoft.lowcostadapter.commons.redis.utils.KeyValueHelper;
import com.derbysoft.lowcostadapter.commons.redis.utils.RedisValueBuilder;

public class RoomType implements RedisSerializable {
    public static final String PREFIX = "RM_TP";

    private int propertyRoomTypeID;

    private String roomTypeCode;

    private  String description;


    @Override
    public String toKey() {
        return PREFIX + KeyValueHelper.SEPARATOR + getPropertyRoomTypeID();
    }

    @Override
    public String toFiled() {
        throw new UnsupportedOperationException("RoomType unsupported toFiled()");
    }

    @Override
    public Long expireTime() {
        return null;
    }

    @Override
    public String value() {
        RedisValueBuilder redisValueBuilder = new RedisValueBuilder();
        redisValueBuilder.append(getRoomTypeCode());
        redisValueBuilder.append(getDescription());
        return redisValueBuilder.toString();
    }

    public int getPropertyRoomTypeID() {
        return propertyRoomTypeID;
    }

    public void setPropertyRoomTypeID(int propertyRoomTypeID) {
        this.propertyRoomTypeID = propertyRoomTypeID;
    }

    public String getRoomTypeCode() {
        return roomTypeCode;
    }

    public void setRoomTypeCode(String roomTypeCode) {
        this.roomTypeCode = roomTypeCode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
